package 算法.集合进阶;

import java.util.ArrayList;
import java.util.Collection;

public class lambda表达式遍历 {
    public static void main(String[] args) {
        // 创建集合
        Collection<String> coll = new ArrayList<>();
        coll.add("zhangsan");
        coll.add("lisi");
        coll.add("wangwu");

        //coll.forEach(new Consumer<String>() {
        //    @Override
        //    public void accept(String s) {
        //        System.out.println(s);
        //    }
        //});

        coll.forEach((s) -> System.out.println(s));

    }


}
